import JSEncrypt from 'jsencrypt'
export function rsaEncrypt (val) { //rsa加密
    let encrypt = new JSEncrypt();
    const publicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoEwf+twztn/6jp/de/iPiOfd60aql0OIumgY44jy5j6KDjqnF9iX1LUanf/bJQ0eOBXj+e4VxYY151EmmGlMdcSWss7hlIUh+qSJcyMiplYPfXwNNXHEmsh2vnRlNhcemzhywTVXMM4etbtWLa628XDA9aqEEWhj5S3p+OL6UlSFWUqcrB4J0oRoy2WKMS0lzAg126I1KT/VIlci6JAZc4W1+zdbXhf5/OnNnnmKaCoRhIAnn72xFSBXxN4ZzGJDhhO/5+0v+YYsFNzRigMucN9K1FXYh5TXeMr1DYI9OOXW6ZzCoFDk4Mvsyr/YDX7Zlx1IezFfS+Q6kqsfwZfFZQIDAQAB';
    encrypt.setPublicKey(publicKey);
    return encrypt.encrypt(val);
}